//
//  NotBoundUseCell.m
//  AILock
//
//  Created by 谭亚明 on 2020/7/15.
//  Copyright © 2020 tym. All rights reserved.
//

#import "NotBoundUseCell.h"
#import "FamilyModel.h"
@interface NotBoundUseCell()

@property(nonatomic,weak) UIImageView *rightImage;
@end

@implementation NotBoundUseCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initUI];
    }
    return self;
}

-(void)initUI{

    self.titlLab = [TYMLabel lb_text:@"zhiwen" font:Font_Medium(15) color:rgba(74, 74, 74)];
    [self.contentView addSubview:self.titlLab];
    
    UIImageView *image = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_list_more"]];
    [self.contentView addSubview:image];
    
    [self.titlLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.contentView);
        make.left.mas_equalTo(15);
    }];
    
    [image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-15);
        make.centerY.mas_equalTo(self.contentView);
    }];

    self.rightImage = image;
}

-(void)setEquUserModel:(EquipmentUserModel *)equUserModel{
    
    self.titlLab.text = equUserModel.equipmentUserName;
}

-(void)hiddenRightImage{
    
    if ([UserTool getCurrentFamily].familyRole == 1) {
        self.rightImage.hidden = NO;
    }else{
       self.rightImage.hidden = YES;
    }
}

+(NSString*)identifier{
    return @"NotBoundUseCell";
}

+(CGFloat)cellForHeight{
    return 45;
}

@end
